<?php
// debug($comments);
$this->Paginator->options(array(
    'update' => '#advicesAnswerContent',
    'evalScripts' => true
));


if (!empty($advices)){
    foreach ($advices as $advice){
        $user = $advice['User'];
        $advice = $advice['VideosAdvicesAnswer'];
        
        ?>

    <div>
        <h4> Posté par <?php echo $this->Display->userLink($user).' le '.$this->Date->getDisplay($advice['posted_on']);?></h4>
        <p>
            <?php echo $advice['content'];?>
        </p>
        
        <div class="">
            <?php echo $advice['pros'];?> votes Pour <?php echo $this->Html->link('+', array('controller' => 'VideosAdvicesPoints', 'action' => 'addPros', $advice['id']));?> </br>  
            <?php echo $advice['cons'];?> votes Contre <?php echo $this->Html->link('-', array('controller' => 'VideosAdvicesPoints', 'action' => 'addCons', $advice['id']));?></br> 
        </div>
    </div>
    <?php
    }
    echo $this->Paginator->prev(' << ' . __('previous'));
    echo $this->Paginator->numbers();
    echo $this->Paginator->next(' >> ' . __('next'));
}
else{
    ?>
    <p> No advices yet, Be the first one ! </p>
<?php
}
?> 
        
        
<?php

echo $this->Js->writeBuffer();
?>